package com.niiwoo.civet.trade.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 可投资标的状态枚举
 * Created by zhangwanli on 2017/11/22.
 */
@Getter
@AllArgsConstructor
public enum InvestableProjectStatusEnum {
    INVESTING((byte) 1, "可投资/投资中"),
    SALE_OUT((byte) 2, "已抢光");
    private Byte value;
    private String desc;

    public static InvestableProjectStatusEnum enumOf(Byte value) {
        for (InvestableProjectStatusEnum statusEnum : values()) {
            if (statusEnum.value.equals(value)) {
                return statusEnum;
            }
        }
        throw new NoSuchEnumValueException("InvestableProjectStatusEnum:" + value);
    }
}
